package com.ruoyi.web.controller.wx;


import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.framework.config.WxCpConfiguration;
import com.ruoyi.system.service.IWxService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 微信小程序用户接口
 *
 * @author <a href="https://github.com/binarywang">Binary Wang</a>
 */
@RestController
@AllArgsConstructor
@Slf4j
@RequestMapping("/wx")
public class WxController {

    private final IWxService wxService;

    private static final String REDICT_URL = "";

    @GetMapping("/sysDept")
    public R<Void> sysDept() {
        try {
            wxService.sysDept();
            return R.ok();
        } catch (WxErrorException e) {
            e.printStackTrace();
            return R.fail(e.getMessage());
        }

    }

    @GetMapping("/sysUser")
    public R<Void> sysUser() {
        try {
            wxService.sysUser();
            return R.ok();
        } catch (WxErrorException e) {
            e.printStackTrace();
            return R.fail(e.getMessage());
        }

    }


}
